<template>
  <div>
    <div class="box">
      <div @click="fun1()">{{ text[1] }}</div>
      <div>{{ text[0] }}</div>
      <div @click="fun1()">{{ text[2] }}</div>
    </div>
    <div class="box1">
      <div><img :src="img" alt="" /></div>
      <div><span>物业费</span></div>
    </div>
    <div class="box2">
      <table>
        <tr>
          <td>序号</td>
          <td>物业名称</td>
          <td>金额</td>
        </tr>
        <tr v-for="(v, i) in obj" :key="i">
          <td v-text="v.prId"></td>
          <td v-text="v.prName"></td>
          <td v-text="v.prMoney"></td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
import { WuYeFei } from "@/apis/lifelink.js";
export default {
  data() {
    return {
      img: "./img/life/cyjf2.png",
      text: ["查询物业费", "<", "X"],
      obj: [],
    };
  },
  methods: {
    fun1() {
      this.$router.push("/life");
    },
  },
  mounted() {
    WuYeFei().then((ok) => {
      console.log(ok.data.data);
      this.obj = ok.data.data;
    });
  },
};
</script>

<style lang="scss" scoped>
.box1 {
  width: 100%;
  text-align: center;
  display: flex;
  margin-top: 0.1rem;
  justify-content: center;
  > div {
    > img {
      width: 0.3rem;
    }
    > span {
      font-size: 0.2rem;
    }
  }
}
.box {
  width: 100%;
  line-height: 0.5rem;
  display: flex;
  border-bottom: 0.01rem solid #999;
  justify-content: space-between;
  height: 0.5rem;
  text-align: center;
  > div:nth-child(2n-1) {
    width: 0.4rem;
    padding: 0 0.1rem;
  }
}
.box2 {
  width: 100%;
  text-align: center;
  > table {
    margin: auto;
    margin-top: 0.3rem;
    border: 0.01rem solid #000;
    width: 90%;
    > tr:nth-child(1) {
      background-color: #eee;
    }
    > tr {
      width: 100%;
      > td {
        width: 33%;
        border: 0.01rem solid #000;
        line-height: 30px;
      }
    }
  }
}
</style>